import numObj from "./index.js";
let reducer = (
  state = {
    ...numObj.state,
  },
  action
) => {
  let newState = JSON.parse(JSON.stringify(state));
  switch (action.type) {
    case numObj.addNum:
      numObj.action[numObj.addNum](newState);
      break;
    case numObj.addNum1:
      numObj.action[numObj.addNum1](newState, action);
      break;
    default:
      break;
  }
  return newState;
};
export default reducer;
